<?php
include("../twitter/header.php");
 mysql_connect ("localhost","root", "root") or die ('Error'.mysql_error());
 mysql_select_db ("streamtube");
 if(isset($_GET['command'])){
 	if($_GET['command'] === 'delete'){
 		$result = mysql_query("UPDATE tweets SET deleted = '1' WHERE id_tweet = '".$_GET['id']."' and username ='".$_SESSION['username']."'");
 	}
	if($_GET['command'] === 'unnew'){
 		$result = mysql_query("UPDATE tweets SET new = '0' WHERE id_tweet = '".$_GET['id']."'and username ='".$_SESSION['username']."'");
 	}
 	if($_GET['command'] === 'addtofavorites'){
 		$result = mysql_query("UPDATE tweets SET favorite = '1' WHERE id_tweet = '".$_GET['id']."'and username ='".$_SESSION['username']."'");
 	}
 	if($_GET['command'] === 'removefromfavorites'){
 		$result = mysql_query("UPDATE tweets SET favorite = '0' WHERE id_tweet = '".$_GET['id']."'and username ='".$_SESSION['username']."'");
 	}
 	
 }    
 mysql_close();
?>